<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>后台-vue</title>
    <link rel="stylesheet" href="css/index.css">
    <script src="../Ajs/vue.min.js"></script>
    <script src="../Ajs/vue-router.js"></script>
</head>
<body>
    <div id="app">
        <back-stage></back-stage>
    </div>

    <script>
        Vue.component("back-stage",{
            data(){
                return {

                }
            },
            template:`<div class="backStage">
                <div class="header">后台管理</div>
                <div class="main">
                    <div class="main_list">
                        <ul>
                            <li class="active"><router-link to="/user">人员管理</router-link></li>
                            <li><router-link to="/goods">商品管理</router-link></li>
                            <li><router-link to="/set"> 相关设置</router-link></li>
                        </ul>
                    </div>
                    <div class="main_con">
                        <router-view></router-view>
                    </div>
                </div>
                <div class="footer">Hello World</div>
            </div>`,
            methods:{

            },
            mounted(){

            }
        });
        const User = {
            data(){
                return {

                }
            },
            template:`<div>人员管理</div>`
        };
        const Goods = {
            data(){
                return {

                }
            },
            template:`<div>商品管理</div>`
        };
        const Set = {
            data(){
                return {

                }
            },
            template:`<div>相关设置</div>`
        };
        var router = new VueRouter({
           routes:[
               {path:"/",redirect:"/user"},
               {path:"/user",component:User},
               {path:"/goods",component:Goods},
               {path:"/set",component:Set},
           ]
        });
        var vm = new Vue({
            el:"#app",
            router:router,
            data:{

            }
        })
    </script>
</body>
</html>
